<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    /*
     * data:返回信息
     * state:返回状态
     * code:错误码
     * */
    public function json($msg,$data='',$state=1,$code=200){

        return json_encode(['msg'=>$msg,'data'=>$data,'state'=>$state,'code'=>$code]);
    }
}
